package com.hospital.hospitalsystem.modules.user.service;

import com.hospital.hospitalsystem.modules.user.dao.entity.ShoppingCartEntity;
import com.hospital.hospitalsystem.modules.user.dao.mapper.ShoppingCartMapper;
import com.hospital.hospitalsystem.modules.user.dto.BuyAndDeleteReq;
import com.hospital.hospitalsystem.modules.user.dto.ShoppingCartListReq;
import com.hospital.hospitalsystem.modules.user.dto.ShoppingCartRsp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author qiancheng@cqxyy.net
 * @date 2023/4/1
 */
@Component
public class ShoppingCartService {

    @Autowired
    private ShoppingCartMapper shoppingCartMapper;

    public void insertSelective(ShoppingCartEntity shoppingCartEntity) {
        shoppingCartMapper.insertSelective(shoppingCartEntity);
    }

    public List<ShoppingCartEntity> selectByExample(Example example) {
        return shoppingCartMapper.selectByExample(example);
    }

    public void updateByExampleSelective(ShoppingCartEntity shoppingCartEntity,Example example) {
        shoppingCartMapper.updateByExampleSelective(shoppingCartEntity,example);
    }

    public void deleteByExample(Example example) {
        shoppingCartMapper.deleteByExample(example);
    }

    public List<ShoppingCartRsp> getMedicalList(ShoppingCartListReq req) {
        return shoppingCartMapper.getMedicalList(req);
    }

    public void deleteByShoppingExt(BuyAndDeleteReq req) {
        shoppingCartMapper.deleteByShoppingExt(req);
    }
}
